home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Palettes / MiscProgressPalette / MiscProgressBarInspector.m < prev    next >
Text File  |  1995-04-12  |  2KB  |  64 lines

  1. //
  2. //    MiscProgressBarInspector.m -- a simple view class for displaying progress
  3. //        Written and Copyright (c) 1993 by James Heiser.  (jheiser@adobe.com)
  4. //                Version 1.0.  All rights reserved.
  5. //
  6. //        This notice may not be removed from this source code.
  7. //
  8. //    This object is included in the MiscKit by permission from the author
  9. //    and its use is governed by the MiscKit license, found in the file
  10. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  11. //    for a list of all applicable permissions and restrictions.
  12. //    
  13.  
  14.  
  15. #import "MiscProgressBarInspector.h"
  16. #import "MiscProgressView.subproj/MiscProgressBar.h"
  17.  
  18. @implementation MiscProgressBarInspector
  19.  
  20. - init
  21. {
  22.     char buf[MAXPATHLEN + 1];
  23.     id bundle;
  24.     
  25.     [super init];
  26.     
  27.     bundle = [NXBundle bundleForClass:[MiscProgressBar class]];
  28.     [bundle getPath:buf 
  29.             forResource:"MiscProgressBarInspector" 
  30.             ofType:"nib"];
  31.     [NXApp loadNibFile:buf 
  32.            owner:self 
  33.            withNames:NO 
  34.            fromZone:[self zone]];
  35.     return self;
  36. }
  37.  
  38. - ok:sender
  39. {
  40.     [object setTicsVisible:[theSwitch intValue]];
  41.     [object setTicsOverBar:[theSwitch2 intValue]];
  42.     [object setTickColor:[tickColorWell color]];
  43.     [object setNumTicks:[tickText intValue]];
  44.     [object setEmphasis:[emphasisText intValue]];
  45.     return [super ok:sender];
  46. }
  47.  
  48. - revert:sender
  49. {
  50.     [theSwitch setState:[object isTicsVisible]];
  51.     [theSwitch2 setState:[object isTicsOverBar]];
  52.     [tickColorWell setColor:[object tickColor]];
  53.     [tickText setIntValue:[object numTicks]];
  54.     [emphasisText setIntValue:[object emphasis]];
  55.     return [super revert:sender];
  56. }
  57.  
  58. - (BOOL)wantsButtons
  59. {
  60.     return NO;
  61. }
  62.  
  63. @end
  64.